Creating a Bound Report using the Crystal ActiveX Control
- Add the following controls to your Visual Basic form:
- On the Data Control:
- Set the DatabaseName property to the name of the database being reported on.
- Set the RecordSource property (this can be a database table or a SQL query statement).
- On the Crystal ActiveX Control:
- Set the DataSource property to the Data Control (for example, Data1).
- Set the ReportSource to 3 - All Data Control Fields.
- On the Command Button, add the following code for the Click event:
Private Sub Command1_Click()
CrystalReport1.Action = 1
End Sub
Run the application, click the command button, and the Crystal ActiveX Control will retrieve data from the Data Control and create the report. The report will appear as a simple columnar report. There are no runtime properties to control any report formatting. However, this can be accomplished at design-time by editing the report designed by the ActiveX control (a report template) in Crystal Reports.